negotiator
Class Timeline

java.lang.Object
  extended by negotiator.Timeline

public abstract class Timeline
extends java.lang.Object

A time line, running from t = 0 (start) to t = 1 (deadline).


Constructor Summary
Timeline()
           
 
Method Summary
abstract  double getCurrentTime()
           
abstract  double getTime()
          Gets the time, running from t = 0 (start) to t = 1 (deadline).
abstract  double getTotalTime()
           
 negotiator.Timeline.Type getType()
           
 boolean isDeadlineReached()
           
 boolean isPaused()
           
 void pause()
          Method used to pause the timeline.
abstract  void printTime()
          Print the current time.
 void resume()
          Method used to resume the timeline.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timeline

public Timeline()
Method Detail

getTime

public abstract double getTime()
Gets the time, running from t = 0 (start) to t = 1 (deadline). The time is normalized, so agents need not be concerned with the actual internal clock.

Returns:
current time in the interval [0, 1].

getTotalTime

public abstract double getTotalTime()
Returns:
amount of time in seconds, or amount of rounds depending on timeline type.

getCurrentTime

public abstract double getCurrentTime()
Returns:
amount of seconds passed, or amount of rounds passed depending on the timeline type.

printTime

public abstract void printTime()
Print the current time.


isDeadlineReached

public boolean isDeadlineReached()
Returns:
true if deadline is reached.

pause

public void pause()
           throws java.lang.Exception
Method used to pause the timeline. This method is only available if it is enabled in the Global.

Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception
Method used to resume the timeline. This method is only available if it is enabled in the Global.

Throws:
java.lang.Exception

getType

public negotiator.Timeline.Type getType()
Returns:
type of time: Type.Time or Type.Rounds.

isPaused

public boolean isPaused()
Returns:
true if timeline is paused.